package cn.kgc.springday04.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author 课工场
 * @date 2023/10/9
 * @description 通过注解完成对象的托管  如何实现属性的初始化
 *  @Value("tom")
 */
@Data
@Component("tea")
public class Teacher {

//    @Value("tom")
//    private String name;

    @Value("${name}")
    private String name;

    @Value("${age}")
    private Integer age;

    @Value("#{'${str}'.split(',')}")
    private String[]  str;

    @Value("#{'${list}'.split(',')}")
    private List<Integer> list;

    @Value("#{${map}}")
    private Map<String,String> map;


}
